﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Security.Cryptography;
using System.IO;
using System.Text;

using CE.User;

public partial class contactus_ContactUs: System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!Page.IsPostBack)
        //{
        //    LogUserViewedHistory();
        //}
        //ChangeProviderLogoList();
    }

    private void ChangeProviderLogoList()
    {
        //    100	Car Insurance
        //    200	Home Refinance
        //    300	Credit Card
        //    400	Personal Loan
        //    500	Personal Accident
        //    600	Travel Insurance
        //Random rnd = new Random();
        //int pValue = rnd.Next(1, 6);
        //pValue = pValue * 100;
        
        //usrCompanyLogoByServices1.CompanyProviderTypeId = pValue.ToString();
        //rnd = null;
    }

    private void LogUserViewedHistory()
    {
        //UserViewHistoryDB _userviewdb = new UserViewHistoryDB();
        //_userviewdb.LogViewedHistory("CTUS", Request, "Contact Us.");
    }

    private void ChangeValidationEffectServerSide(string strValidationGroup)
    {
        //Loan Purpose
        //if (rfvEmail.Enabled && rfvEmail.ValidationGroup == strValidationGroup)
        //{
        //    rfvEmail.Validate();
        //    if (rfvEmail.IsValid == false)
        //    {
        //        txtEmail.ControlStyle.CssClass = "validationError";
        //    }
        //    else
        //    {
        //        txtEmail.ControlStyle.CssClass = "";
        //    }
        //}
        //else
        //{
        //    txtEmail.ControlStyle.CssClass = "";
        //}
    }

    protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        //ChangeValidationEffectServerSide("subscriber");
        //if (Page.IsValid)
        //{
        //    UserSubscriber _usersub = new UserSubscriber();
        //    UserSubscriberDB _usersubdb = new UserSubscriberDB();
        //    _usersub.Email = txtEmail.Text;
        //    if (_usersubdb.Insert(_usersub) > 0)
        //    {
        //        divThankYou.Visible = true;
        //        lblThankYou.Text = "Your email has been added in E-Newsletter list. Thank you very much!";
        //        txtEmail.Enabled = false;
        //        ibtSubscribe.Enabled = false;
        //    }
        //}
    }
}
